/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Amelia
 */
@Entity(name = "ExtendedOperatingHour")
public class ExtendedOperatingHoursEntity extends OperatingHoursEntity implements Serializable {

    private static final long serialVersionUID = 1L;
    @Temporal(value = TemporalType.DATE)
    private Date specificDate;
    @ManyToOne
    private BranchEntity branch;

    public ExtendedOperatingHoursEntity() {
        super();
    }

    public ExtendedOperatingHoursEntity(OperatingHoursEntity operatingHoursEntity, Date specificDate) {
        super(operatingHoursEntity);
        this.specificDate = specificDate;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (getId() != null ? getId().hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ExtendedOperatingHoursEntity)) {
            return false;
        }
        ExtendedOperatingHoursEntity other = (ExtendedOperatingHoursEntity) object;
        if ((this.getId() == null && other.getId() != null) || (this.getId() != null && !this.getId().equals(other.getId()))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.ExtendedOperatingHours[ id=" + getId() + " ]";
    }

    public Date getSpecificDate() {
        return specificDate;
    }

    public void setSpecificDate(Date specificDate) {
        this.specificDate = specificDate;
    }

    public BranchEntity getBranch() {
        return branch;
    }

    public void setBranch(BranchEntity branch) {
        this.branch = branch;
    }
}
